package com.cn.jx.manager.service.query.Impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.cn.jx.manager.dao.DataGridRepository;
import com.cn.jx.manager.po.DataGrid;
import com.cn.jx.manager.service.query.IDataGridServiceQry;
import com.jx.enumType.DataGrideTypeEnum;
import com.jx.enumType.SwitchEnum;

@Service("dataGridServiceQry") 
@Transactional
public class DataGridServiceImplQry implements IDataGridServiceQry {

	@Autowired
	private DataGridRepository dataGridDao;

	@Override
	@Transactional(readOnly = true)
	public List<DataGrid> findAllGridByType(DataGrideTypeEnum type) {
		return dataGridDao.findDataGridByType(type.getId());
	}

	@Override
	@Transactional(readOnly = true)
	public List<DataGrid> findAllGridByTypeOn(DataGrideTypeEnum type) {
		return dataGridDao.findDataGridByTypeAndOn(type.getId(), SwitchEnum.ON.getCode());
	}

}
